#ifndef CUSTOMCONTROL_H
#define CUSTOMCONTROL_H

#include <QEvent>
#include <QLineEdit>
#include <QMouseEvent>
#include <QObject>

// 工具类：提供为 QLineEdit 添加 clicked 信号的方法
class CustomControl : public QObject
{
    Q_OBJECT

public:
    explicit CustomControl(QObject *parent = nullptr);

    // 静态方法：为 QLineEdit 添加 clicked 信号
    static void addClickSignal(QLineEdit *lineEdit);

signals:
    void clicked(); // 自定义 clicked 信号

protected:
    bool eventFilter(QObject *watched, QEvent *event) override; // 事件过滤器

private:
    static CustomControl *getOrCreateInstance(QLineEdit *lineEdit);
};

#endif // CUSTOMCONTROL_H
